<?php
namespace app\common\model;


class CnzzModel extends BaseModel
{
    protected $name = 'cnzz'; //定义用户表
    //开启自动写入时间戳
    protected $autoWriteTimestamp = false;
    // 定义自动完成的属性
    protected $auto = []; //新增修改
    protected $insert = []; //插入
    protected $update = []; //修改


    public function activation($siteId,$name,$password){
        $cnzz = new \org\net\Cnzz($name,$password);
        if($cnzz->login() == true){
            $this->where('site_id',$siteId)->setField('is_active',1);
            return true;
        }else{
            $this->where('site_id',$siteId)->setField('is_active',0);
            $this->error = $cnzz->getError();
            return false;
        }
    }
}